<template>
	<el-table v-loading="state.dataListLoading" :data="state.dataList" border style="width: 100%" @selection-change="selectionChangeHandle">
		<el-table-column prop="typeGroup" label="分组" width="180" />
		<el-table-column prop="typeGroupName" label="分组名称" width="180" />
		<el-table-column prop="typeCode" label="类型代码" />
		<el-table-column prop="typeName" label="类型名称" />
	</el-table>
	<el-pagination
		:current-page="state.page"
		:page-sizes="state.pageSizes"
		:page-size="state.limit"
		:total="state.total"
		layout="total, sizes, prev, pager, next, jumper"
		@size-change="sizeChangeHandle"
		@current-change="currentChangeHandle"
	>
	</el-pagination>

	<!-- 详情 -->
	<!-- <detail ref="detailRef"></detail> -->
</template>

<script lang="ts" setup>
import { useCrud } from '@/hooks'
import { reactive, ref } from 'vue'

const state: IHooksOptions = reactive({
	dataListUrl: '/sys/contract/type/page',
	deleteUrl: '/sys/contract/type',
	queryForm: {
		platformId: '',
		platform: ''
	}
})

const detailRef = ref()
const detailHandle = (row: any) => {
	detailRef.value.init(row)
}

const { getDataList, selectionChangeHandle, sizeChangeHandle, currentChangeHandle, deleteBatchHandle } = useCrud(state)
</script>

<style>
.el-table .warning-row {
	--el-table-tr-bg-color: var(--el-color-warning-light-9);
}
.el-table .success-row {
	--el-table-tr-bg-color: var(--el-color-success-light-9);
}
</style>
